home *** CD-ROM | disk | FTP | other *** search
- Path: news.unt.edu!news
- From: Steve Fogoros <sfogoros@hsc.unt.edu>
- Newsgroups: comp.lang.c
- Subject: Re: Invalid Indirection???
- Date: Wed, 13 Mar 1996 21:59:52 -0800
- Organization: University of North Texas Health Science Center
- Message-ID: <3147B5D8.1BA2@hsc.unt.edu>
- References: <4i7cck$t67@infa.central.susx.ac.uk>
- NNTP-Posting-Host: sfogoros.hsc.unt.edu
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.0 (Win16; I)
-
- Doan Nguyen wrote:
-
- ...
-
- > float tempa, tempb, tempi, tempj [NPIC-1];
-
- tempi should be declared tempi [NPIC-1] since you use it later as an array.
- This is what lead to the error.
-
-
- > tempi_p = &tempi;
- > tempj_p = &tempj;
-
- should be tempi_p = &tempi[0]; or tempi_p = tempi;
- do same for tempj_p
-
-
- > tmp = (tempi[i]*tempj[i])+(tempi[i+1]*tempj[i+1]));
-
- The indirection error was caused by trying to use tempi as an array when you
- declared it an integer. You should have also gotten a warning when you assigned
- &tempi to tempi_p just before the pi assignment.
-
- The extra close pren at the end of the line will cause problems. Its error was
- masked by the invalid indirection.
-
- ...
-
- Sorry about all the cutting but Netscape for some reason would not let me post
- with more included text then orignal? I guess that's for the best bandwidth wise.
-
- --
- Steve Fogoros, Academic Information Coordinator
- University of North Texas Health Science Center
- sfogoros@hsc.unt.edu
-